package com.appleyk.query;

import com.appleyk.model.Movie;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.data.repository.query.Param;

public interface SalaryRecordsQuery extends Neo4jRepository<Movie, Long> {

    /**
     * 获取 员工 奖金 情况
     * @param name name
     * @return return
     */
    @Query("match(n:Employees)-[:appoint]->(m:Salaryrecords) where n.name={name} return m.bonus")
    String getSalaryBonus(@Param("name") String name);

    /**
     * 获取 员工 津贴或补贴 情况
     * @param name name
     * @return return
     */
    @Query("match(n:Employees)-[:appoint]->(m:Salaryrecords) where n.name={name} return m.allowances")
    String getSalaryAllowances(@Param("name") String name);

}
